local task_id_list = redis.call('ZRANGEBYSCORE', KEYS[1], '-inf', ARGV[1])
if next(task_id_list) ~= nil then
    if redis.call('ZREMRANGEBYSCORE', KEYS[1], '-inf', ARGV[1]) > 0 then
        return task_id_list
    else
        return {}
    end
else
    return {}
end